/**
 * 前沿进展
 * 
 * */

import React from 'react';
import { withRouter } from "react-router-dom";
import { useCallback } from 'react';
import { formatTime } from '@/util/util'

const Qianyan = (props) => {
  const { data, history } = props;
  const gotoDetail = useCallback(() => {
    history.push('./qianyanDetail?id=' + data.id)
  }, [data.id, history])
  return (
    <div className="Qianyan-box" onClick={gotoDetail}>
      <div className="Qianyan-box-t">
        <div className="Qianyan-box-t-img">
          <img src={data.listImgUrl} alt="" />
        </div>

        <div className="Qianyan-box-right">
          <p className="Qianyan-title">{data.title}</p>
          <p className="Qianyan-shortIntroduce">{data.shortIntroduce}</p>
        </div>
      </div>

      <div className="Qianyan-box-b">
        <p>发布时间：{formatTime(data.pubTime)}</p>
      </div>
    </div>
  )
}


export default withRouter(React.memo(Qianyan)); 